/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package fr.ensisa.sunspot.event;

/**
 *
 * @author michel
 */
public interface IEvent {

    IEvent clone ();
    int getMajor();
    int getMinor();
    int getState();
    String getSource();
    long getTimeStamp();

    void setMajor(int major);
    void setMinor(int minor);
    void setState(int state);
    void setSource(String source);
    void setTimeStamp(long timeStamp);

// Fields in an event
    public static final int FIELD_STATE     = 0x000000FF;
    public static final int FIELD_MAJOR     = 0x0000FF00;
    public static final int FIELD_MINOR     = 0x00FF0000;

// State of the event
    public static final int STATE_EMPTY           = 0x00;
    public static final int STATE_RAW             = 0x01;
    public static final int STATE_RELEASED        = 0x02;
    public static final int STATE_PRE_STARTED     = 0x04;
    public static final int STATE_STARTED         = 0x08;
    public static final int STATE_REPEATED        = 0x10;
    public static final int STATE_PRE_ENDED       = 0x20;
    public static final int STATE_ENDED           = 0x40;

    public static final int STATE_NOTRAW          = STATE_RELEASED |
                                                    STATE_PRE_STARTED |
                                                    STATE_STARTED |
                                                    STATE_REPEATED |
                                                    STATE_PRE_ENDED |
                                                    STATE_ENDED;

    public static final int STATE_USEFULL         = STATE_STARTED |
                                                    STATE_REPEATED |
                                                    STATE_ENDED;
// Major of the event
    public static final int MAJOR_NO              = 0 << 8;
    public static final int MAJOR_SETUP           = 1 << 8;
    public static final int MAJOR_ACCELERATION    = 2 << 8;
    public static final int MAJOR_TILT            = 3 << 8;
    public static final int MAJOR_SWITCH          = 4 << 8;
    public static final int MAJOR_LIGHT           = 5 << 8;
    public static final int MAJOR_TEMPERATURE     = 6 << 8;
    public static final int MAJOR_RADIO           = 7 << 8;
    public static final int MAJOR_COMPOSITE       = 8 << 8;
    public static final int MAJOR_LED             = 9 << 8;
    public static final int MAJOR_KEYBOARD        = 10 << 8;
    public static final int MAJOR_MOUSE           = 11 << 8;

// Minor of the event
    public static final int MINOR_NO              = 0x00 << 16;

    public static final int MINOR_X               = 0x01 << 16;
    public static final int MINOR_Y               = 0x02 << 16;
    public static final int MINOR_Z               = 0x04 << 16;

    public static final int MINOR_0               = 0x00 << 16;
    public static final int MINOR_1               = 0x01 << 16;
    public static final int MINOR_2               = 0x02 << 16;
    public static final int MINOR_3               = 0x04 << 16;
    public static final int MINOR_4               = 0x08 << 16;
    public static final int MINOR_5               = 0x10 << 16;
    public static final int MINOR_6               = 0x20 << 16;
    public static final int MINOR_7               = 0x40 << 16;

    public static final int MINOR_LEFT            = 0x01 << 16;
    public static final int MINOR_RIGHT           = 0x02 << 16;
    
    public static final int MINOR_Keybd_event	  = 0x01 << 16;
    // uses an dwFlagEvent
    public static final int MINOR_SetForegroundWindow	  = 0x02 << 16;
    // uses an StringEvent 
    public static final int MINOR_PostMessage	  = 0x04 << 16;
    // uses an MessageEvent
    public static final int MINOR_SendMessage	  = 0x08 << 16;
    // uses an MessageEvent
    public static final int MINOR_SetCursorPos	  = 0x10 << 16;
    // uses an DoubleIntegerEvent
    public static final int MINOR_CursorUp	 	  = 0x20 << 16;
    // uses an IntegerEvent
    public static final int MINOR_CursorDown	  = 0x40 << 16;
    // uses an IntegerEvent
    public static final int MINOR_CursorLeft	  = 0x80 << 16;
    // uses an IntegerEvent
    public static final int MINOR_CursorRight	  = 0x1b << 16;
    // uses an IntegerEvent
    public static final int MINOR_Mouse_event	  = 0x36 << 16;
    // uses an MouseEvent
    
// Source of the event
    public static final String UNKNOWN_SOURCE	  = "UNKNOWN_SOURCE";
}
